package com.zhihao.takeaway.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhihao.takeaway.entity.Dish;
import com.zhihao.takeaway.entity.DishFlavorVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface DishMapper extends BaseMapper<Dish> {

    @Select("select dish.*,flavor.name as flavorName,flavor.value from dish , flavor where if(#{marketId} != 'admin', #{marketerId} = dish.marketer_id,dish.marketer_id != '') and dish.flavor_id = flavor.id")
    List<DishFlavorVo> selectDishFlavor(String marketerId);
}
